<template>
    <div>
        <div class="li">
            <div class="img">
                <img :src="imgUrl(roomData.imgPath)" alt="">
            </div>

            <div class="name">
                <div> {{roomData.name}}</div>
            </div>

            <div class="info">
                <!-- <div>区域：{{roomData.floor_name}}</div>
                <div>类型：{{roomData.type_name}}</div> -->
                <div>状态：<span :style="roomData.status==1?'color: #00FF00;':'color: #00CED1;'">{{roomData.status==1?'正常':'维护中'}}</span></div>
                <div>设备数：{{roomData.status==1?roomData.devicecount.online:0}}/{{roomData.devicecount.total}}</div>
                <div >告警：<span style="color: red;">{{roomData.alarm}}</span></div>
            </div>

            <div class="btn">
                <el-button size="small " @click="goRoomDevice(roomData.id)">进入房间</el-button>
            </div>
            
        </div>
    </div>
</template>

<script>


export default{
    name:"roomList",
    data() {
      return {
        
      }
    },
    props:{
        roomData:{
            type:Object,
            default:{}
        }
    },
    components:{

},
mounted(){
    // console.log(this.roomData)
    
},
  methods:{
    imgUrl(imgPath){
        return cfg.img_url+imgPath+ '?' + Date.now()
        
    },
    goRoomDevice(id){
        this.$router.push({ path: '/roomdevice', query:{roomId:id}})
    }
  },
  computed:{
    
  }
    
  }
</script>
<style lang="scss" scoped>
    .li{
        height: 100px;
        // border: 1px solid red;
        border-bottom: 1px solid rgba(11,44,108,1);
        display: flex;
        flex-direction: row;
        .img{
            width: 80px;
            height: 90px;
            margin: 5px 20px;
            img{
                width: 100%;
                height: 100%;
            }
        }
        .name{
            width: 100px;
            margin-left: 20px;
            margin-top: 10px;
            font-size: 15px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .info{
            display: flex;
            flex-direction: row;
            
            justify-content: space-between;
            width: 400px;
            height: 30px;
            line-height: 30px;
            font-size: 13px;
            // border: 1px solid red;
            // margin-left: auto;
            float: left;
            margin-left: 230px;
            margin-top: 60px;
            
        }
        .btn{
            // float: right;
            margin-left: auto;
            margin-right: 30px;
            margin-top: 30px;
        }
    }

</style>